package com.mazaiting.classfile.attr.info;

import com.mazaiting.classfile.ClassReader;
import com.mazaiting.classfile.attr.entity.ElementValueEntity;
import com.mazaiting.classfile.constant.ConstantPool;

/**
 * 注解默认属性
 *
 * @author mazaiting
 * @since 2021/8/13
 */
public class AnnotationDefaultAttribute extends AttributeInfo{
    /**
     * 节点属性实体
     */
    private ElementValueEntity defaultValue;

    public AnnotationDefaultAttribute(ConstantPool pool, int index, int length) {
        super(pool, index, length);
    }

    @Override
    public void readInfo(ClassReader reader) {
        this.defaultValue = ElementValueEntity.read(reader, pool);
    }

    @Override
    public String toString() {
        return "AnnotationDefaultAttribute{" +
                "defaultValue=" + defaultValue +
                ", nameIndex=" + nameIndex +
                ", length=" + length +
                '}';
    }
}


















